import { Body, Controller, Get, Logger, Post } from '@nestjs/common'
import { ConfigService } from '@nestjs/config'
import { UserService } from './user.service'

@Controller('user')
export class UserController {
  // private logger = new Logger(UserController.name);
  constructor(
    private userService: UserService,
    private configService: ConfigService,
    private readonly logger: Logger,
  ) {
    this.logger.warn('UserController初始化')
  }
  @Get()
  getUsers() {
    this.logger.log('获取用户列表')
    return this.userService.findAll()
  }

  @Get('/profile')
  getUserProfile() {
    return this.userService.findProfile(1)
  }

  @Post('/test')
  test(@Body() data) {
    console.log(12345, data)
    return '12312'
  }
}
